Link to this headingVyOS

Configure VyOS as a software-based router for your Home Lab’s private networks

VyOS is an open-source network operating system based on Debian GNU/Linux in console.

Link to this headingBasic Configuration

Enter configuration mode:

configure

Set hostname:

set system host-name 'vyos-router'

Configure interfaces:

# WAN interface (DHCP) set interfaces ethernet eth0 description 'WAN' set interfaces ethernet eth0 address dhcp # LAN interface (static) set interfaces ethernet eth1 description 'LAN' set interfaces ethernet eth1 address 192.168.1.1/24

Configure NAT:

set nat source rule 100 outbound-interface 'eth0' set nat source rule 100 source address '192.168.1.0/24' set nat source rule 100 translation address 'masquerade'

Configure DHCP server:

set service dhcp-server shared-network-name LAN subnet 192.168.1.0/24 default-router '192.168.1.1' set service dhcp-server shared-network-name LAN subnet 192.168.1.0/24 dns-server '192.168.1.1' set service dhcp-server shared-network-name LAN subnet 192.168.1.0/24 range 0 start '192.168.1.100' set service dhcp-server shared-network-name LAN subnet 192.168.1.0/24 range 0 stop '192.168.1.200'

Commit and save configuration:

commit save

Link to this headingAdvanced Features

Firewall configuration:

# Create firewall rules set firewall name WAN_LOCAL default-action 'drop' set firewall name WAN_LOCAL rule 10 action 'accept' set firewall name WAN_LOCAL rule 10 state established 'enable' set firewall name WAN_LOCAL rule 10 state related 'enable' # Apply to interface set interfaces ethernet eth0 firewall local name 'WAN_LOCAL'